using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableWantedSpecialTimeDao:DaoBase<TableWantedSpecialTime>
    {
        public override void AddPrimaryIndex(TableWantedSpecialTime model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableWantedSpecialTime.txt";
        }

        protected override TableWantedSpecialTime ParseRowData(string[] rowData)
        {
            TableWantedSpecialTime data = new TableWantedSpecialTime();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.id = 0;
            }
            else
            {
                data.id = int.Parse(rowData[0]);
            }
			data.StartTime = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.Type = 0;
            }
            else
            {
                data.Type = int.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.Odd = 0;
            }
            else
            {
                data.Odd = int.Parse(rowData[3]);
            }
			data.NormalAttackCost = rowData [4];
			data.RageAttackCost = rowData [5];

            if (string.IsNullOrEmpty(rowData[6]))
            {
                data.PerformanceIndex = 0;
            }
            else
            {
                data.PerformanceIndex = int.Parse(rowData[6]);
            }

            if (string.IsNullOrEmpty(rowData[7]))
            {
                data.CoreIndex = 0;
            }
            else
            {
                data.CoreIndex = int.Parse(rowData[7]);
            }

            return data;
        }



    }

}
